export default {

	data() {
		return {
			title: "我的课程",
			StatusBar: this.StatusBar,
			CustomBar: this.CustomBar,
			list: [],
			loadStatus: 'load',
			isLoading: false,
			boxH: this.bodtyH,
			orderList: [],
			nowTime: '',

		};
	},
	onLoad() {
		let data = {
			action: "getMyCourseList",
			openId: this.Reques.sessionData.data.openId
		};
		this.loadData(data);
		let setTime = setInterval(() => {
			this.nowTime = (new Date()).getTime() / 1000;
		}, 2000);

	},
	onShareAppMessage(res) {
		console.log("分享的openid " + this.initCode);
		return {
			title: "乐知课程艺术中心",
			path: '/pages/index/index?userCode=' + this.initCode
		}
	
	},
	onShow(){
		console.log("刷新");
		
	},
	methods: {
		/**
		 * 加载我的课程的数据表
		 */
		loadData(data) {
			this.Reques.commonQuest("xcx/course.api.php", "POST", data).then((res) => {
				console.log(res.data.course);
				if (res.statusCode == 200 && res.data.code == 0) {
					this.isLoading = true;
					this.orderList = res.data.course;
					
				} else {
					this.loadStatus = 'error2';
				}
			}, (err) => {
				this.loadStatus = 'error2';
				console.log(err);
			});
		},
		/**
		 * 时间戳转换为日期格式
		 * @param {Object} str
		 */
		todate(str) {
			return this.Reques.to_date(str,0);
		},
		
		toGood(id) {
			console.log("id" + id);
			uni.navigateTo({
				url: '/pages/goodDetail/home?courseId=' + id,
				animationType: 'slide-in-left'

			})


		}



	}



}
